package leetcode;

import java.util.Dictionary;
import java.util.HashMap;

public class Test0001 {
    public static void run(){
        int[] nums={3,2,4};
        int[] result=new int[2];
        HashMap<Integer,Integer> dic=new HashMap<Integer, Integer>();
        int target=6;

        for(int i=0;i<nums.length;i++){
            dic.put(nums[i],i);
        }
        for(int i=0;i<nums.length;i++){
            if(dic.containsKey(target-nums[i]) && i!=dic.get(target-nums[i]))
            {
                result[0]=i;
                result[1]=dic.get(target-nums[i]);
                break;
            }
        }

        System.out.println(result[0]);
        System.out.println(result[1]);
    }
}
